package com.three.crm.require;

import android.content.Context;
import com.three.crm.http.CommonResultCallBack;
import com.three.crm.http.OkHttpUtils;
import org.json.JSONObject;

public class AppRequireService {
    /**
     * 登录
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void onLogin(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.User.login,requireCode,jsonObject,callBack);
    }

    /***
     * 获取登录用户信息
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryUserInfo(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.User.info,requireCode,jsonObject,callBack);
    }

    /**
     * 获取腾讯云上传附件的相关配置信息
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void getCosTokenData(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.File.getToken,requireCode,jsonObject,callBack);
    }

    /**
     * 获取阿里云上传附件
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void getCosConfig(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.File.getAliToken,requireCode,jsonObject,callBack);
    }

    /**
     * 消息列表
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryMessageList(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Common.messageList,requireCode,jsonObject,callBack);
    }

    public static void queryArrivalInfoList(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Common.arrivalInfo,requireCode,jsonObject,callBack);
    }

    /**
     * 未读消息数
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryMessageNumber(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Common.messageNumber,requireCode,jsonObject,callBack);
    }

    /**
     * 消息已读
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void readMessage(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Common.messageRead,requireCode,jsonObject,callBack);
    }

    /**
     * 查询货物
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void uploadLog(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Common.saveLog,requireCode,jsonObject,callBack);
    }

    /**
     * 经理批复
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void replyOrder(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Procure.orderReply,requireCode,jsonObject,callBack);
    }

    /**
     * 查询货物
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryGoodsList(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Common.goodsList,requireCode,jsonObject,callBack);
    }

    /**
     * 查询省市区
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryArea(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Common.getArea,requireCode,jsonObject,callBack);
    }

    /**
     * 表单详情
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryFormDetail(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Common.getFormDetail,requireCode,jsonObject,callBack);
    }

    /**
     * 关于我们
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryArticle(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Common.getArticle,requireCode,jsonObject,callBack);
    }

    /**
     * 首页统计
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryStatistics(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Common.statistics,requireCode,jsonObject,callBack);
    }

    /**
     * 上传位置
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void uploadLocation(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Common.uploadLocation,requireCode,jsonObject,callBack);
    }

    /***
     * 查询货物
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryProduceList(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Produce.list,requireCode,jsonObject,callBack);
    }

    /**
     * 查询货物详情
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryProduceDetail(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Produce.detail,requireCode,jsonObject,callBack);
    }

    /**
     * 添加货物登记
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void addProduce(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Produce.add,requireCode,jsonObject,callBack);
    }

    /**
     * 查询磅单列表
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryPoundList(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Procure.pound_list,requireCode,jsonObject,callBack);
    }

    /**
     * 添加磅单
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void poundEdit(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Procure.pound_add,requireCode,jsonObject,callBack);
    }

    /**
     * 查询采购单列表
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryOrderList(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Procure.order_list,requireCode,jsonObject,callBack);
    }

    /**
     * 添加采购单
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void orderEdit(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Procure.order_add,requireCode,jsonObject,callBack);
    }

    /**
     * 查询伙伴
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryCompanyList(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Partner.list,requireCode,jsonObject,callBack);
    }

    /**
     * 添加伙伴
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void companyEdit(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Partner.add,requireCode,jsonObject,callBack);
    }

    /**
     * 伙伴详情
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryCompanyDetail(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Partner.detail,requireCode,jsonObject,callBack);
    }

    /**
     * 拉黑伙伴
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void companyBlack(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Partner.black,requireCode,jsonObject,callBack);
    }

    /**
     * 查询拜访列表
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryVisitList(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Visit.list,requireCode,jsonObject,callBack);
    }

    /**
     * 添加拜访
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void visitEdit(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Visit.add,requireCode,jsonObject,callBack);
    }

    /**
     * 查询反馈列表
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryFeedbackList(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Feedback.list,requireCode,jsonObject,callBack);
    }

    /**
     * 添加反馈
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void feedbackEdit(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Feedback.add,requireCode,jsonObject,callBack);
    }

    /**
     * 地勤填写最终扣款金额
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void modifyFeedbackMoney(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Feedback.enterMoney,requireCode,jsonObject,callBack);
    }

    /**
     * 查询任务列表
     * @param context
     * @param requireCode
     * @param jsonObject
     * @param callBack
     */
    public static void queryTaskList(Context context, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack){
        doPost(context, Api.Task.list,requireCode,jsonObject,callBack);
    }

    private static void doPost(Context context, String url, int requireCode, JSONObject jsonObject, CommonResultCallBack callBack) {
        OkHttpUtils.onPostJson(context,url,requireCode,jsonObject.toString(),callBack);
    }
}
